/**
 * Created by iallai on 8/1/2018.
 */
import Cookies from 'js-cookie'

const app = {
  state: {
    navbar: {
      status: Cookies.get('navbarStatus')||true
    },
    roles:[]
  },
  mutations: {
    HIDE_NAVBAR: state => {
      Cookies.set('navbarStatus', false);
      state.navbar.status = false;
    },
    OPEN_NAVBAR: (state, language) => {
      Cookies.set('navbarStatus', true);
      state.navbar.status = true;
    }
  },
  actions: {
    hideNavBar({ commit }) {
      console.log("sdsd");
      commit('HIDE_NAVBAR')
    },
    openNavBar({ commit }) {
      commit('OPEN_NAVBAR')
    }
  }
}

export default app
